<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>ocr</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <style>
    html, body, .wrapper, #camera {
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
    }
     #camera {
      position: absolute;
      top: 0;
      left: 0;
     }
     video {
        width: 100%;
        height: auto;
     }
  </style>
</head>
<body>
  <div class="wrapper">
    <div id="camera"></div>
  </div>
  <script src='./webcam.js'></script>
  <script>
    Webcam.set({
      image_format: 'png',
      jpeg_quality: 90
    });

    Webcam.attach( '#camera' );

    function take_snapshot() {
      Webcam.snap( function(data_uri) {
        document.getElementById('my_result').innerHTML = '<img src="'+data_uri+'"/>';
      } );
    }
  </script>
</body>
</html>